<template>
  <div class="my-setup">
    <h1 v-my-directive>This is a Heading</h1>
  </div>
</template>

<script setup lang="ts">
// <script setup> 中的代码会在每次组件实例被创建的时候执行
defineOptions({
  inheritAttrs: false,
  customOptions: {
    /* ... */
  }
});
const slots = defineSlots<{
  default(props: { msg: string }): any;
}>();
console.log("slots ", slots);
const vMyDirective = {
  beforeMount: el => {
    // 在元素上做些操作
    console.log("el>>>", el);
  }
};
</script>
<style lang="scss" scoped>
.my-setup {
  color: #000;
}
</style>
